Dear All, |
Re: How to create a link from a link using DXL
Your nomencature is a little confusing, but it looks like module B links to both A and C.
Skip skpB = create() // B objects linked to this A object
Skip skpC = create() // C objects linked from the B objects
Object oA = obj // easier to read
Object oB, oC
Link lnk
// Load module B and C invisible read only Standard vies
read(NameBModule, false, true)
read(NameCModule, false, true)
// [1] Gather B objects
for lnk in oA <-"*" do
{ oB = source(lnk)
if (null oB) continue
if (oB is not in module B) continue
put(skpB, oB, oB)
}
// [2] Gather C objects
for oB in skpB do
{ for lnk in oB ->"*" do
{ oC = target(lnk)
if (null oC) continue
if (oC is not in module C) continue
put(skpC, oC, oC)
}
}
// [3] Summarize C objects
Buffer buf = create
string EOL = ""
for oC in skpC do
{ buf += EOL
buf += identifier(oC)
buf += "\t"
buf += whatever else about C
EOL = "\n" // get ready for next display
}
string Results = stringOf(buf)
delete(buf)
delete(skpB)
delete(skpC)
// [4] Display Results
obj.attrDXLName = Results
|
Re: How to create a link from a link using DXL By having your links following one direction only, this would have allowed you to take full advantage of DOORS features like the Analysis Wizard which would have gone a long way towards solving your problem. Paul Miller Melbourne, Australia |
Re: How to create a link from a link using DXL SystemAdmin - Tue Feb 01 17:59:37 EST 2011 Paul Miller Melbourne, Australia
Thank you all!
// display change proposals
{
// check status
if ((current Project) != null)
{
string sCPModulePath = null
Module m = current
string this_module = fullName(m)
// ensure proposal module is open
LinkRef lr
Link OUT
// process in-links
for lr in (obj <- S_MOD_CPLINKS_PATH()) do
{
sCPModulePath = fullName(source lr)
// only relevant if module exists with r access
if (exists(module sCPModulePath) == true)
{
// only relevant if module is closed
if (open(module sCPModulePath) == false)
{
// ensure module is open
read(sCPModulePath, false)
}
break
}
}
// only relevant if module exists with r access
if (exists(module sCPModulePath) == true)
{
Link l
Link R
// process in-links
for l in obj <- (S_MOD_CPLINKS_PATH()) do
{
Object oProposal = source l
// check status
if (oProposal != null)
{
string sStatus = probeAttr_(oProposal, S_ATTR_STATUS)
// only relevant for proposals that are not rejected or applied
if (sStatus != S_REJECTED)
{
// padding
for R in (oProposal -> "*") do
{
sCPModulePath2 = fullName(target R)
if (open(module sCPModulePath2) == false){
read(sCPModulePath2, false)
}
Object oProposal2 = target R
if (fullName(target R) != this_module){
display "CP: "probeAttr_(oProposal2, "Absolute Number")
}
}
}
}
}
}
if (isLastObjectInDXLSet obj){
string cpsModName = fnGetCPModulePath(fullName(module(obj)))
Module cpsMod = read (cpsModName, false)
// cpsMod will be NULL if cps is not configured for this module.
// Don't close the module if it is open visible (i.e. CP partner is open).
if (null != cpsMod && !isVisible(cpsMod)){
close cpsMod
}
}
}
}
|